Skip to content

Conversation

@marcfargas
Copy link

@marcfargas marcfargas commented Feb 8, 2026

Summary

Adds Windows support to surf-cli. All core features tested and working on Windows 11 ARM64 with Chromium (scoop), Node 24, and ImageMagick 7.

Changes

Socket communication (host.cjs, cli.cjs, do-executor.cjs, mcp-server.cjs)

  • Use Windows named pipes (//./pipe/surf) instead of Unix domain sockets (/tmp/surf.sock) when process.platform === "win32"
  • Skip fs.unlinkSync(SOCKET_PATH) on Windows (named pipes don't need cleanup)
  • Skip fs.chmodSync(SOCKET_PATH, 0o600) on Windows (not applicable to named pipes)

Temp file paths (host.cjs, cli.cjs)

  • Route all temp files to %LOCALAPPDATA%/Temp/surf/ instead of /tmp/ on Windows
  • Affected: log file, auto-screenshots (pi-auto-*), snap screenshots (surf-snap-*), error screenshots (surf-error-*)

ImageMagick resize (host.cjs, cli.cjs)

  • Quote the geometry argument on Windows to prevent cmd.exe from interpreting > as a file redirect
  • Before: magick "file.png" -resize 1200x1200\> "file.png" → cmd eats the >, corrupts the file
  • After: magick "file.png" -resize "1200x1200>" "file.png" → works correctly

Network store (network-store.cjs)

  • Default base path to %LOCALAPPDATA%/Temp/surf/ on Windows instead of /tmp/surf

Testing

Tested end-to-end on Windows 11 ARM64 with Chromium 144 (scoop), Node 24, ImageMagick 7.1:

Feature Status
tab.list / tab.new / tab.switch
go (navigate) / back / forward
read / read --compact / page.text
click <ref> / type <text> / key
snap (screenshot + ImageMagick resize)
snap --full / snap --output
scroll / scroll.info
js <code>
search / locate.role
window.new / window.list / window.close
--window-id isolation
cookie.list
perf.metrics
Auto-screenshots on click

Notes

  • No changes to Linux/macOS behavior — all platform checks fall through to existing code paths
  • The native host installer (install-native-host.cjs) already had Windows support via registry entries; no changes needed there
  • ImageMagick convert (IM6) → magick (IM7) fallback chain preserved, just the geometry quoting changes on Windows

- Use named pipes (//./pipe/surf) instead of Unix sockets on win32
- Route temp files to %LOCALAPPDATA%/Temp/surf instead of /tmp
- Fix ImageMagick resize: quote geometry arg to prevent cmd.exe
  interpreting > as redirect
- Skip Unix-only operations (chmod, unlink socket) on win32
- Network store defaults to %LOCALAPPDATA%/surf on Windows

Tested on Windows 11 ARM64 with Chromium (scoop), Node 24,
ImageMagick 7. All core features working: navigation, page reading,
screenshots (with resize), tab management.
@marcfargas marcfargas marked this pull request as ready for review February 8, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant